﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;

namespace ValidationFramework.Configuration.Fluent
{
	/// <summary>
	/// This implements both interfaces so that when its implicitly type the consumers choices are limited
	/// </summary>
	public class RuleConfigurationStep : IRuleConfigurationStep, IRuleFailureConfigurationStep
	{
		// the current rule being constructed
		public Rule _rule;

		/// <summary>
		/// Initializes a new instance of the RuleOptions class.
		/// </summary>
		public RuleConfigurationStep(Rule rule)
		{
			_rule = rule;
		}

		#region IRuleOptions Members

		public IRuleFailureConfigurationStep OnFailure()
		{
			return this;
		}
		public IRuleConfigurationStep When()
		{
			throw new NotImplementedException();
		}	
		public IRuleConfigurationStep Priority(int priorityLevel)
		{
			throw new NotImplementedException();
		}
		#endregion

		#region IOnFailureOptions Members

		public IRuleFailureConfigurationStep Severity(int severity)
		{
			throw new NotImplementedException();
		}

		public IRuleFailureConfigurationStep UseMessage(string message)
		{
			_rule.ErrorMessage = message;
			return this;
		}

		public IRuleFailureConfigurationStep UseErrorMessageProvider()
		{
			_rule.UseErrorMessageProvider = true;
			return this;
		}

		#endregion

	}
}
